import pygame

from game.data.assets.assetManager import load_image
from game.sprites.player.player import *
from game.sprites.sprites import SpritesContainer, GroupsContainer
class Level:
    def __init__(self):
        self.display_surface=pygame.display.get_surface()
        #sprite group setup
        self.visible_sprites= GroupsContainer.visible_group
        self.obstacle_sprites = GroupsContainer.obstacle_group
        self.player = SpritesContainer.getPlayer()
        #sprite setup

        # layout={
        #     'boundary':import_csv_layout()
        # }
        
    def animate(self):

        if self.player.direction != Direction.NONE: self.player.animate()
        
        for mob in SpritesContainer.getMobs():
            if mob.direction != Direction.NONE: mob.animate()

    def update(self):
        #update and draw the game
        self.visible_sprites.custom_draw(SpritesContainer.PLAYER.player)


        self.visible_sprites.update()


